# 打开源文件和目标文件，指定源文件编码为 GBK，目标文件编码为 UTF-8
with open('jian.txt', 'r', encoding='gbk', errors='ignore') as infile, open('output_file.txt', 'w', encoding='utf-8') as outfile:
    data_dict = {}  # 用于存储字典

    # 逐行读取文件
    for line in infile:
        # 去掉行末换行符并根据 @ 分割
        parts = line.strip().split('@')

        if len(parts) >= 2:
            # 将第0位作为字典的值，第1位作为字典的键
            value = parts[0]
            key = parts[1]

            # 更新字典
            data_dict[key] = value

            # 写入到目标文件
            outfile.write(f"'{key}':[{value}],")

print("处理完成")
